import { createStore } from 'vuex'

import createPersistedState from "vuex-persistedstate";

export default createStore({
  state: {
    // 设置页面相关参数储存地址
    ipMacData:[],
    // 与气体检测仪和手环交互命令储存地址
    orderData:[],
    // 本机固定ip
    selfIp: '',
    // 是否是第一次打开 第一个打开从配置文件获取数据
    fristOpen: false
  },
  getters: {
  },
  mutations: {
    changeIpMacData(state, value) {
      state.ipMacData = value
    },
    changeOrderData(state, value) {
      state.orderData = value
    },
    changeSelfIP(state, value) {
      state.selfIp = value
    },
    changeFristOpen(state, value) {
      state.fristOpen = value
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    createPersistedState({storage: window.localStorage})
  ]
})
